package xju.springboot_17_18.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import xju.springboot_17_18.entity.User;

import java.util.List;

public interface UserMapper {

    @Select("select  * from newtable")
    List<User> selectAll();

    User selectById(int id);

    @Select("select * from newtable where sn=#{sn} and password = #{pwd}")
    User selectBySnAndPwd(@Param("sn") String sn, @Param("pwd") String pwd);

    @Insert("insert into newtable(name,sn,password) values (#{name},#{sn},#{password})")
    Integer insert(User user);
}
